package com.sky.controller.user;

import com.sky.dto.UserLoginDTO;
import com.sky.result.Result;
import com.sky.service.UserService;
import com.sky.vo.UserLoginVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * PROJECT_NAME: sky-take-out
 * NAME: UserController
 *
 * @AUTHOR: zhang
 * DATE: 2023/11/28
 * DESCRIPTION :
 */
@Slf4j
@Api(tags = "C端-用户信息表现层接口") //@Api:用户描述类的相关信息
@RestController
@RequestMapping("/user/user")
public class UserController {
    @Resource
    private UserService userService;

    @ApiOperation("用户登录")
    @PostMapping("/login")
    private Result<UserLoginVO> userLogin(@RequestBody UserLoginDTO userLoginDTO){
        log.info("【C端-用户登录】，{}",userLoginDTO);
        UserLoginVO userLoginVO = userService.login(userLoginDTO);
        return Result.success(userLoginVO);
    }

}
